package com.zhijie.common.config;

import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class JacksonConfig {
    /**
     * 描述:统一配置类型的转换策略
     */
//    @Bean
//    public Jackson2ObjectMapperBuilderCustomizer jackson2ObjectMapperBuilderCustomizer() {
//        return builder -> {
//            //将Long类型转换成string类型返回，避免大整数导致前端精度丢失的问题
//            builder.serializerByType(Long.TYPE, ToStringSerializer.instance);
//            builder.serializerByType(Long.class,ToStringSerializer.instance);
//        };
//    }
}
